Skip to content

Conversation

@jonahgraham
Copy link
Contributor

Each use of a timer creates a User Object in Windows, and once we have stopped waiting for our desired event we don't need the cancellation tracking anymore.

If there are lots of calls to processOSMessagesUntil, such as repeated browser.setText within the MAXIMUM_OPERATION_TIME (5 second) window, we can end up with a huge growth in the number of User Objects, leading to potential SWTError: No more handles errors elsewhere in the client code.

Fixes #2806

@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2025

Test Results

  118 files  ±0    118 suites  ±0   18m 12s ⏱️ + 1m 57s
4 655 tests +2  4 638 ✅ +2  17 💤 ±0  0 ❌ ±0 
  338 runs  ±0    334 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit a1fa734. ± Comparison against base commit a0d6ffc.

♻️ This comment has been updated with latest results.

@jonahgraham
Copy link
Contributor Author

@HeikoKlare I don't know how to automate a regression test for this, I assume the existing test cases will cover it sufficiently.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the catch, @jonahgraham!
The change sounds totally reasonable to me. I agree that we probably don't need an additional regression test for this. Still, what about just adding a test that basically consists of your snippet from #2806 followed by a control creation to ensure that no "no more handles" error occurs?
I.e., something like:

for (int i = 0; i < 20000; i++) {
	browser.setText("Iteration " + i);
	new BrowserFunction(browser, "name");
}
new Composite(shell, SWT.NONE);

@jonahgraham
Copy link
Contributor Author

I.e., something like:

Done.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

Each use of a timer creates a User Object in Windows, and once we
have stopped waiting for our desired event we don't need the cancellation
tracking anymore.

If there are lots of calls to processOSMessagesUntil, such as repeated
browser.setText within the MAXIMUM_OPERATION_TIME (5 second) window,
we can end up with a huge growth in the number of User Objects, leading
to potential `SWTError: No more handles` errors elsewhere in the client
code.

Fixes eclipse-platform#2806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edge integration leaves unused Timers around

2 participants